package com.leo.blog.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.leo.blog.entity.Visit;

public interface VisitDao {
	int insertVisit(Visit visit);
	int insertSelective(Visit visit);
	
	int deleteVisitById(int visitId);
	
	int updateVisit(Visit visit);
	int updateVisitSelect(Visit visit);
	
	Visit queryVisitById(int visitId);
	Visit queryVisitByIp(String visitIp);
	Long queryVisitByTimesCount(Visit visit);
	
	/**
	 * 模糊查询分组查询
	 */
	List<Visit> queryVisitListByPage(@Param("visitCondition") Visit visitCondition, @Param("rowIndex") int rowIndex, 
			@Param("pageSize") int pageSize);
	int queryVisitListByPageCount(@Param("visitCondition") Visit visitCondition);
	
	/**
	 * 模糊查询,分组显示
	 * @param visitCondition
	 * @param rowIndex
	 * @param pageSize
	 * @return
	 */
	List<?> queryVisitListByGroupIp(@Param("visitCondition") Visit visitCondition, @Param("rowIndex") int rowIndex, 
			@Param("pageSize") int pageSize);
	int queryVisitListByGroupIpCount(@Param("visitCondition") Visit visitCondition);
	/**
	 * 根据日期分组查询
	 * @param visitCondition
	 * @param rowIndex
	 * @param pageSize
	 * @return
	 */
	List<?> queryVisitListByDate(@Param("visitCondition") Visit visitCondition);
	/**
	 * 根据IP分组查询
	 * @param visitCondition
	 * @return
	 */
	List<?> queryVisitListByIp();
}
